tests/libtest: Allow specifying GPG homedir to cleanup
authorDan Nicholson <nicholson@endlessm.com>
Mon, 17 Jun 2019 18:37:35 +0000 (13:37 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 19 Jun 2019 17:17:11 +0000 (17:17 +0000)
In case the tests want to use a custom GPG homedir, allow passing in the
homedir to use when cleaning up a running gpg-agent.

Closes: #1872
Approved by: cgwalters

tests/libtest.sh

index e0022512e02bdfe33d67674b053d676880a44390..5f381c671300777dccd82b8cb1a6b9ddbcb5e16c 100755 (executable)
@@ -601,7 +601,8 @@ has_gpgme () {
 }
 
 libtest_cleanup_gpg () {
-    gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye || true
+    local gpg_homedir=${1:-${test_tmpdir}/gpghome}
+    gpg-connect-agent --homedir "${gpg_homedir}" killagent /bye || true
 }
 
 is_bare_user_only_repo () {